package com.logistics.map.entity.model;

import com.logistics.map.entity.domain.MapRoute;
import com.logistics.utils.tool.DateUtils;
import lombok.Data;

@Data
public class MapRouteRow {

    private Integer id;

    private String name;

    private String code;

    private String map;

    private String creator;

    private String createTime;

    private String updater;

    private String updateTime;

    public MapRouteRow(){

    }

    public MapRouteRow(MapRoute mapRoute){
        this.id = mapRoute.getId();
        this.name = mapRoute.getName();
        this.code = mapRoute.getCode();
        this.creator = mapRoute.getCreator();
        this.createTime = DateUtils.dateToStringFormat(mapRoute.getCreateTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
        this.updater = mapRoute.getUpdater();
        this.updateTime = DateUtils.dateToStringFormat(mapRoute.getUpdateTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
    }

    public static MapRouteRow build(MapRoute mapRoute){
        return new MapRouteRow(mapRoute);
    }
}
